package com.fsql.controller;

import com.fsql.utils.FlinkRestClientUtils;
import com.fsql.utils.HttpUtils;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/jobmanager")
public class JobManager {
    @GetMapping("/config")
    public ResponseEntity<String> config() {
        String url = String.format("%s/config", FlinkRestClientUtils.getInterfaceUrl());
        return new ResponseEntity<>(HttpUtils.doGet(url), HttpStatus.OK);
    }

    @GetMapping("/log")
    public ResponseEntity<String> log() {
        String url = String.format("%s/log", FlinkRestClientUtils.getInterfaceUrl());
        return new ResponseEntity<>(HttpUtils.doGet(url), HttpStatus.OK);
    }
}
